from scrapy import Request, Spider

from ..items import MovieItem


class Scrape1Spider(Spider):
    name = 'scrape1'
    allowed_domains = ['ssr1.scrape.center']
    base_url = 'https://ssr1.scrape.center'
    max_page = 10
    start_urls = ["https://ssr1.scrape.center/page/1"]
    
    def parse(self, response):
        item = MovieItem()
        item['name'] = "test"
        item['directors'] = []
        item['directors'].append({
            'name': "威廉·惠勒",
            'image': "https://p1.meituan.net/movie/169af816a0d3f32581d5610b93b6f3467739.jpg"
        })
        item['actors'] = []
        item['actors'].append({
            'name': "奥黛丽·赫本",
            'image': "https://p1.meituan.net/movie/97bcea4bf8001374393d86394fe2390e30462.jpg"
        })
        yield item
